<template>
  <div v-color="'red'">
    <h2>局部中定义指令</h2>
    <input type="text" v-focus="{ h: 20, w: 100 }" />
  </div>
</template>

<script>
export default {
  name: 'page-day29',
  directives: {
    focus: {
      inserted(el, binding) {
        el.style.width = binding.value.w + 'px'
        el.style.height = binding.value.h + 'px'
        el.focus()
      }
    }
  }
}
</script>

<style lang="scss" scoped></style>
